﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true"
    CodeFile="Profile.aspx.cs" Inherits="admin_Users_Profile" %>

<%@ Register TagName="TabMenu" TagPrefix="menu" Src="~/admin/Person/Menu.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
      <link href="<%: ResolveUrl("~/Styles/smoothness/jquery-ui-1.9.2.custom.min.css") %>" rel="stylesheet" />
        <script src="<%: ResolveUrl("~/Scripts/jquery.ui.datepicker-vi.js") %>" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#<%=txtBirthday.ClientID %>").datepicker({
             changeMonth: false
            , changeYear: false
            , dateFormat: 'dd/mm/yy'
            , regional: 'vi'
            , duration: 'slow'

         });
     });            
    </script>
    <script type="text/javascript">
        jQuery(document).ready(function () {
            jQuery(".timkiem").colorbox({ width: "500px", inline: true, href: "#frmAddNew" });
        });
        function closeOverlay() {
            $.colorbox.close();
        }
       
        function addRole(personId) {
            var roleid = $("#ddlRoles").val();            
            return $.dalatcooking.jsonPersonAddRole(personId, roleid);
        }

        
        //ShowStatus('warning', 'Thêm mới chuyên mục thất bại.');
    </script>
    
    <div style="display: none;">
        <div id="frmAddNew" class="overlaypanel">
            <h2>Thay đổi mật khẩu</h2>
            <ul class="fl">
                <li>
                    <label>Mật khẩu cũ</label>
                    <br />
                    <asp:TextBox runat="Server" ID="txtPassword" Width="300" TextMode="Password" />

                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="Server" ValidationGroup="changePass"
                        ControlToValidate="txtPassword" ErrorMessage="*" Display="Dynamic" />
                </li>

                <li>
                    <label>Mật khẩu mới</label>
                    <br />
                    <asp:TextBox runat="Server" ID="txtPasswordNew" Width="300" TextMode="Password" />

                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="Server" ValidationGroup="changePass"
                        ControlToValidate="txtPasswordNew" ErrorMessage="*" Display="Dynamic" />

                </li>

                <li>
                    <label>Nhập lại Mật khẩu</label>
                    <br />
                    <asp:TextBox runat="Server" ID="txtPasswordNew2" Width="300" TextMode="Password" />

                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="Server" ValidationGroup="changePass"
                        ControlToValidate="txtPasswordNew2" ErrorMessage="*" Display="Dynamic" />
                    <asp:CompareValidator ID="compare" runat="server" ControlToCompare="txtPasswordNew" ControlToValidate="txtPasswordNew2"
                        ErrorMessage="*" ValidationGroup="changePass"></asp:CompareValidator>
                </li>

            </ul>
            <asp:Button runat="server" ID="btnChangePass" ValidationGroup="changePass" CssClass="btn primary"
                OnClientClick="colorboxDialogSubmitClicked('changePass', 'frmAddNew');"
                Text="Lưu thay đổi" OnClick="btnChangePass_Click" />
            hoặc <a href="#" onclick="closeOverlay();">Hủy</a>
        </div>
    </div>
    <div class="content-box-outer">
        <asp:PlaceHolder ID="phRightContentBox" runat="server">
            <div class="content-box-right">
                <menu:TabMenu ID="mymenuadsf" runat="server" />
            </div>
        </asp:PlaceHolder>
        <div class="content-box-left">
            <h1 style="border: none;">Hồ sơ:
                <asp:Label ID="lblProfile" runat="server" Text=""></asp:Label>


                <a href="#" class="timkiem">Đổi mật khẩu
                </a>

            </h1>




            <div id="Container">
                <h2>Hồ sơ</h2>




                <table class="tblForm">
                    <tr>
                        <td>
                            <label for="txtFirstName" class="lbl">
                                Họ và tên lót</label>
                            <asp:TextBox ID="txtFirstName" class="txt200" runat="server" />
                        </td>
                        <td>
                            <label for="txtEmail" class="lbl indent">
                                Email</label>
                            <asp:TextBox ID="txtEmail" class="txt200" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="txtLastName" class="lbl">
                                Tên</label>
                            <asp:TextBox ID="txtLastName" class="txt200" runat="server" />
                        </td>
                        <td>
                            <label for="txtBirthday" class="lbl">
                                Ngày sinh</label>
                            <asp:TextBox ID="txtBirthday" class="txt200" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="txtMiddleName" class="lbl">
                                Tên lót</label>
                            <asp:TextBox ID="txtMiddleName" class="txt200" runat="server" />
                        </td>
                        <td>
                            <label for="txtPhotoURL" class="lbl">
                                Avatar</label>
                            <asp:TextBox ID="txtPhotoURL" class="txt200" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="txtDispalayName" class="lbl">
                                Tên hiển thị</label>
                            <asp:TextBox ID="txtDispalayName" class="txt200" runat="server" />
                        </td>
                        <td>
                            <label for="chkPrivate" class="lbl">
                                &nbsp;</label>
                            <div class="clear">
                            </div>
                            <div style="padding-top: 8px">
                                <asp:CheckBox ID="chkPrivate" runat="server" />
                                <label for="chkPrivate">
                                    Riêng tư</label>
                            </div>
                        </td>
                    </tr>
                </table>
                <asp:PlaceHolder ID="phRoles" runat="server">
                    <h2>Quyền</h2>
                    <div id="rolelist" style="margin: 0 0 20px;">
                        <asp:DropDownList ID="ddlRoles" runat="server" Width="250"></asp:DropDownList>
                        <input type="button" id="btnAssign" value="Gán quyền" onclick="return addRole(<%=PersonID %>)"  class="btn primary rounded" />
                        <br />
                        <asp:Repeater id="RolesRepeater" runat="server">
					<ItemTemplate>
						<table width="30%">
							<tr>
								<td><%# DataBinder.Eval(Container.DataItem, "RoleName")%></td>
								<td align="right"><a href="#" onclick="return $.dalatcooking.jsonPersonRemoveRole(<%=PersonID %>, <%#Eval("RoleId") %>)">Xóa</a></td>
							</tr>
						</table>
					</ItemTemplate>
				</asp:Repeater>
                        <br />
                    </div>
                </asp:PlaceHolder>
                <h2>Thông tin liên hệ</h2>
                <table class="tblForm">
                    <tr>
                        <td colspan="2">
                            <label class="lbl">Địa chỉ</label>
                            <asp:TextBox ID="txtAddress" runat="server" Width="430px" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="txtMobile" class="lbl">
                                Di động</label>
                            <asp:TextBox ID="txtMobile" class="txt200" runat="server" />
                        </td>
                        <td>
                            <label for="txtCity" class="lbl">
                                Thành phố</label>
                            <asp:TextBox ID="txtCity" class="txt200" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="txtMainPhone" class="lbl">
                                Điện thoại</label>
                            <asp:TextBox ID="txtMainPhone" class="txt200" runat="server" />
                        </td>
                        <td>
                            <label for="txtState" class="lbl">
                                Vùng miền</label>
                            <asp:TextBox ID="txtState" class="txt200" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="txtFax" class="lbl">
                                Fax</label>
                            <asp:TextBox ID="txtFax" class="txt200" runat="server" />
                        </td>
                        <td>
                            <label for="txtCountry" class="lbl">
                                Quốc gia</label>
                            <asp:TextBox ID="txtCountry" class="txt200" runat="server" />
                        </td>
                    </tr>
                </table>
                <h2>Về tôi</h2>
                <div style="margin: 0 0 20px;">
                    <asp:TextBox ID="txtBiography" TextMode="MultiLine" Style="width: 430px; height: 50px"
                        runat="server" />
                </div>
            </div>
            <div id="Container2">
            </div>
            <div class="action_buttons">
                <asp:Button ID="btnSave" runat="server" CssClass="btn primary rounded" Text="Lưu"
                    OnClientClick="return SaveProfile()" OnClick="btnSave_Click" />
                hoặ
                <a href="Default.aspx">Hủy</a>
            </div>
        </div>
    </div>
</asp:Content>
